﻿<?php get_header(); ?>				
				<div id="banner">
				<ul class="clearfix">
				<?php 
					
					$cat=get_category_by_slug('homenews');
					 $args = array(
					 		'showposts'=>3,
							'orderby' => 'id',
							'order' => 'DESC',
							'category__in'=>array($cat->cat_ID),
						);						
					 query_posts($args);
					 	$i=0;				
					?>
				<?php while ( have_posts() ) : the_post(); $i++;?>
						<?php if($i<=3){?>
						<li class="item">
					<a href="<?php echo get_permalink()?>">
						<?php echo the_post_thumbnail('full',array('class'=>'bannerimage','title'=>get_the_title(),'alt'=>get_the_title()) );?>						
						<h2><?php 
						$a=post_custom('short_title');
						echo empty($a)?get_the_title():$a.'...'?></h2>
					</a>
				</li>
						
			<?php }?>
			<?php endwhile?>
				
			</ul>
		</div>
		
		<div id="newssection">
			<h4>Tin tức - mẹo vặt</h4>
			<ul class="row">
        <?php 
					
					$cat=get_category_by_slug('news');
					$catnotin=get_category_by_slug('homenews');
					 $args = array(
					 		'showposts'=>4,
							'orderby' => 'id',
							'order' => 'DESC',
							'category__in'=>array($cat->cat_ID),
					 		'category__not_in'=>array($catnotin->cat_ID),
						);						
					 query_posts($args);
					 	$i=0;				
					?>
				<?php while ( have_posts() ) : the_post(); $i++;?>
				<li class="block_product <?php if($i==1)echo 'firstitem'?>"> 
    <a class="product_image" href="<?php echo get_permalink()?>">           
              		<span class="price price-new">chi tiết</span>    
    <?php echo the_post_thumbnail('medium',array('style'=>'width:220px;height:220px','title'=>get_the_title(),'alt'=>get_the_title()) );?>                                             
      </a>
      <div>
        <h3><a class="product_link" href="<?php echo get_permalink()?>" title=""><?php echo get_the_title()?></a></h3>
        <p class="product_desc"><?php echo get_the_excerpt()?></p>
        
                </div>
    </li>
				<?php endwhile?>
       
      </ul>
		</div>
							
<?php get_footer(); ?>